package com.jeff.practice;

import java.util.ArrayList;
import java.util.Scanner;

/**
 * 输入一个 int 型整数，按照从右向左的阅读顺序，返回一个不含重复数字的新的整数。
 * 保证输入的整数最后一位不是 0 。
 * <p>
 * 数据范围：1≤n≤10^8
 *
 * @author yaojianfeng
 */
public class ReverseInteger {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int i1 = in.nextInt();
        while (i1 % 10 == 0) {
            i1 = in.nextInt();
        }
        String target = String.valueOf(i1);
        char[] cr = target.toCharArray();
        ArrayList<Character> result = new ArrayList<>(8);
        StringBuilder builder = new StringBuilder();
        for (int i = cr.length - 1; i >= 0; i--) {
            if (result.contains(cr[i])) {
                continue;
            }

            result.add(cr[i]);
            builder.append(cr[i]);
        }
        System.out.println(builder);
    }


}
